import request from '@/utils/request'

export function savePatent(paperData) {
    return request({
        url: '/patents/save',
        method: 'post',
        data: paperData
    })
}

export function deletePdfPage(filePath, pageNumber) {
    return request({
        url: '/deletePdfPage',
        method: 'post',
        params: { filePath, pageNumber }
    })
}


export function getPatent(params) {
    return request.post('/patents/getPatents', params);
}

export function deletePatent(id) {
    return request.delete(`/patents/deleteById/${id}`);
}

/**
 * 根据id来查询专利信息
 */
export function getPatentById(id) {
    return request.get(`/patents/getPatentsById/${id}`);
}

/**
 * 更新专利信息
 */
export function updatePatent(patentData) {
    return request.put('/patents/update', patentData);
}
/**
 * 根据多个id批量查询论文信息
 */
export function getPatentsByIds(ids) {
    return request.post(`/patents/getPatentsByIds`, ids);
}

/**
 * 批量导出论文信息
 */
export function exportPatent(params) {
    return request.post(`/patents/export/patents`, params, {
        responseType: 'blob'
    });
}
